/*
 * @Descripttion:
 * @version:
 * @Author: xcb
 * @Date: 2021-04-02 15:47:20
 * @LastEditors: gzy 810461372@qq.com
 * @LastEditTime: 2023-08-29 14:52:26
 */
import { post, get, fileDownload } from "./https";

// 获取方案列表
export const getPlanList = (p) => post("/model/listPlans", p, true);

// 新增方案
export const addYcPlan = (p) => post("/model/yiweiCreatePlan", p, true);

// 查看当前方案是否为该用户所创建
export const verifyPlannoOfUser = (p) =>
  post("/model/verifyPlannoOfUser", p, true);

// 修改方案步长参数
export const updateYiweiYcPlan = (p) =>
  post("/model/updateYiweiYcPlan", p, true);

// 参数方案写入
export const saveWriteParameter = (p) =>
  post("/model/saveWriteParameter", p, true);

// 坝前水位数据写入
export const reservoirLevelWrite = (p) =>
  post("/model/ReservoirLevelWrite", p, true);

// 坝前水位数据读取
export const reservoirLevelRead = (p) =>
  post("/model/ReservoirLevelRead", p, true);

// 删除方案
export const removePlan = (p) => post("/model/remove", p, true);

// 获取成果站点
export const getSingleAttribute = (p) =>
  post("/model/getSingleAttribute", p, true);

// 沿程成果导出
export const exportwriteexcel = (p) => fileDownload("/model/Ycwriteexcel", p);

// 过程成果导出
export const ycwriteexcel = (p) => fileDownload("/model/Gcwriteexcel", p);

// 获取成果河流
export const getAloneLine = (p) => post("/model/getAloneLine", p, true);

// 成果获取报汛数据
export const validateReal = (p) => post("/model/validateReal", p, true);

// 成果获取整编数据
export const validateZB = (p) => post("/model/validateZB", p, true);

// 方案预设
export const getSchemeData = (p) => post("/real/realStRsvrR", p, true);

// 获取站点实时数据
export const getRiverData = (p) => post("/real/realStRiverR", p, true);

// 获取水库实时数据
export const getRsvrrData = (p) => post("/real/realStRsvrR", p, true);

// 获取水库悬浮框数据
export const getRealData = (p) => post("/real/RealNewData", p, true);

// 查询站点坐标
export const getStSedCoordinate = (p) =>
  post("/real/getStSedCoordinate", p, true);

// 查询沙峰推进
export const getSandPeakDate = (p) => post("/model/getSandPeakDate", p, true);

// 查询多库输沙量对比
export const getAreaContrast = (p) => post("/real/getAreaContrast", p, true);

// 方案入库成果geojson数据查询
export const searchPlanResultmap = (p) =>
  post("/model/resultCymapShow", p, true);

// 方案入库成果图表数据查询
export const searchPlanResultmapData = (p) =>
  post("/model/resultCymapData", p, true);

// 方案预设预设计算值
export const getWaterLevelList = (p) => post("/model/getWaterLevelList", p);

/**
 * @description: 根据库区获取断面测次
 * @return {*}
 */
export const getSectionMsno = (p) => post("/model/selectByReservoir", p, true);

// 获取边界条件
export const getCalculateBoundary = (p) =>
  post("/model/calculateBoundary", p, true);

// 读取本地已有方案的边界条件
export const getReadBoundary = (p) => post("/model/readBoundary", p, true);

// 获取河道断面
export const getSelectSections = (p) =>
  post("/model/selectSectionsNew", p, true);

// 获取河流树状数据
export const getSelectAreaRiverList = (p) =>
  post("/model/selectAreaRiverList", p, true);

// 读取步长参数
export const readPreferences = (p) => post("/model/readPreferences", p, true);

// 写入边界条件文本
export const writeBoundary = (p) => post("/model/writeBoundary", p);

// 边界条件文本入库
export const getDataFlowWrittenDatabase = (p) =>
  post("/model/getDataFlowWrittenDatabase", p);

// 进行计算
export const runYiWeiModel = (p) => post("/model/runYiWeiModel", p, true);

// 进行每日预测方案计算
export const runYiWeiModelYB = (p) => post("/model/runYiWeiModelYB", p, true);

// 终止计算
export const killHydroSim = (p) => post("/model/killHydroSim", p, true);

// 获取方案状态
export const runningState = (p) => post("/model/runingState", p, true);

// 导出
export const exportExcelFile = (p) => fileDownload("/model/exportExcelFile", p);

// 导入
export const uploadExcelFile = (p) => post("/model/uploadExcelFile", p, true);

// 成果存入
export const reslutPlanSave = (p) =>
  post("/model/getdatawrittendatabaseall", p, true);

// 方案评估减淤
export const getJyDiaoDuList = (p) => post("/model/JyDiaodu", p, true);

// 方案评估排沙
export const getPsDiaoDuList = (p) => post("/model/PsDiaodu", p, true);

// 获取历史预报数据
export const getselectStsedflist = (p) =>
  post("/model/selectStsedflist", p, true);

// 计算参数读取
export const readSediment = (p) => post("/model/readSediment", p, true);

// 计算参数写入
export const writeSediment = (p) => post("/model/writeSediment", p, true);

// 计算参数1读取
export const readSed = (p) => post("/model/readSed", p, true);

// 计算参数1写入
export const writeSed = (p) => post("/model/writeSed", p, true);

// 糙率读取
export const readMat = (p) => post("/model/readMat", p, true);

// 糙率写入
export const writeMat = (p) => post("/model/writeMat", p, true);

// 读取百分比
export const readLog = (p) => post("/model/LogTextRead", p, true);

// 地图断面查找坐标
export const dmSearch = (p) => post("/model/dmSearch", p, true);

// 查询断面最后一个测次形态
export const selectMsxsrsEnd = (p) => post("/model/selectMsxsrsEnd", p, true);

// 查询断面六要素
export const getSectionSix = (p) => post("/model/getSectionSix", p, true);

// 断面新增名称验证
export const sectionNameVerify = (p) =>
  post("/swns/selectXscdfoXsinfo", p, true);

/* ——————————————————————长江中下游api部分—————————————————————— */
// 方案新增
export const insertScheme = (p) =>
  post("/yangTzeModelParameterScheme/insertScheme", p, false);

// 边界条件写入
export const writeCJWater = (p) => post("/yangTzeModel/writeWater", p, false);

// 模型运行
export const runPython = (p) =>
  post("/yangTzeModelParameterScheme/runPython", p, false);

// 成果入库
export const planPutStorage = (p) =>
  post("/yangTzeModelParameterScheme/putStorage", p, false);

// 获取边界条件
export const getCjCalculateBoundary = (p) =>
  post("/yangTzeModel/calculateBoundary", p, false);

// 获取河流断面信息
export const getCjSectionInfo = (p) =>
  post("/yangTzeModel/sectionInfo", p, false);

// 获取河流糙率信息
// export const getCjRoughnessInfo = (p) =>
//   post("/yangTzeModel/roughnessInfo", p, false);

// 获取河道断面树状图信息
export const getCJMainStreamInfo = (p) =>
  post("/yangTzeModel/mainStreamInfo", p, false);

// 写入河流糙率信息
export const writeCJRoughness = (p) =>
  post("/yangTzeModel/writeRoughness", p, false);

// 写入河流床沙级配
export const writeCJBedGradation = (p) =>
  post("/yangTzeModel/writeBedGradation", p, false);

// 获取河流颗粒级配
// export const getCjParticlesInfo = (p) =>
//   post("/yangTzeModel/particlesInfo", p, false);

// 写入河流颗粒级配
export const writeCJParticles = (p) =>
  post("/yangTzeModel/writeParticles", p, false);

// 读取成果数据
export const readResultFile = (p) =>
  post("/yangTzeModel/readResultFile", p, false);

/* ————————————参数方案———————————— */
// 所有参数方案新增
export const addDefaultScheme = (p) =>
  post("/yangTzeModelParameterScheme/defaultScheme", p, false);

// 获取河流糙率信息
export const queryCJRoughnessScheme = (p) =>
  post("/yangTzeModelParameterScheme/queryRoughnessScheme", p, false);

// 河流糙率信息修改
export const updateCJRoughness = (p) =>
  post("/yangTzeModelParameterScheme/updateRoughness", p, false);

// 获取泥沙参数——协沙力系数
export const queryParticlesScheme = (p) =>
  post("/yangTzeModelParameterScheme/queryParticlesScheme", p, false);

// 获取河流床沙级配
export const queryBedGradationScheme = (p) =>
  post("/yangTzeModelParameterScheme/queryBedGradationScheme", p, false);

// 河流糙率信息修改
export const updateCJParticles = (p) =>
  post("/yangTzeModelParameterScheme/updateParticles", p, false);
/* ——————————————————————长江中下游api结束—————————————————————— */

/* ——————————————————————参数方案api部分—————————————————————— */
// 参数方案列表
export const selectArgumentsInfoList = (p) =>
  post("/swns/selectArgumentsInfoList", p, true);

// 参数方案新增
export const addArgumentsInfo = (p) =>
  post("/swns/addArgumentsInfoList", p, true);

// 参数方案初始含沙量修改
export const updataArgumentsInfoListNs = (p) =>
  post("/swns/updataArgumentsInfoListNs", p, true);

// 参数方案删除
export const delArgumentsInfo = (p) =>
  post("/swns/delArgumentsInfoList", p, true);

// 参数方案查询所储存的各参数ID
export const selectArgumentsInfoListbyid = (p) =>
  post("/swns/selectArgumentsInfoListbyid", p, true);
/* ——————————————————————参数方案api结束—————————————————————— */

/* ——————————————————————初始化参数api部分—————————————————————— */
// 初始化参数获取
export const searchNstjArguments = (p) =>
  post("/swns/selectNstjArguments", p, true);

// 初始化参数列表获取
export const searchNstjArgumentsInfo = (p) =>
  post("/swns/selectNstjargumentsinfo", p, true);

// 初始化参数新增/编辑
export const editNStjArguments = (p) => post("/swns/addnstiaojian", p, true);

// 初始化参数删除
export const delNstjArguments = (p) => post("/swns/delNstjArguments", p, true);
/* ——————————————————————初始化参数api结束—————————————————————— */

/* ——————————————————————河道糙率api部分—————————————————————— */
// 河道糙率参数列表获取
export const searchClArgumentsInfo = (p) =>
  post("/swns/selectClargumentsinfo", p, true);

// 河道糙率参数新增/修改
export const addClArguments = (p) => post("/swns/addclArguments", p, true);

// 河道糙率获取
export const searchAllClArguments = (p) =>
  post("/swns/selectALLclArgumentsAndAllClTributaryArguments", p, true);

// 河道糙率删除
export const delCLArgyments = (p) => post("/swns/delCLArgyments", p, true);
/* ——————————————————————河道糙率api结束—————————————————————— */

/* ——————————————————————泥沙参数api部分—————————————————————— */
// 泥沙参数方案全部数据获取
export const selectNsArguments = (p) =>
  post("/swns/selectNsArguments", p, true);

// 泥沙参数列表获取
export const searchNSArgumentsTypeInfo = (p) =>
  post("/swns/selectNSArgumentsTypeinfo", p, true);

// 泥沙参数新增
export const addNSTypeArguments = (p) =>
  post("/swns/addNSTypeArguments", p, true);

// 泥沙参数新增
export const delNsArgumentsTypeInfo = (p) =>
  post("/swns/delNsargumentstypeinfo", p, true);

// 泥沙参数获取
export const searchNsArgumentsType = (p) =>
  post("/swns/selectNsArgumentsType", p, true);
/* ——————————————————————泥沙参数api结束—————————————————————— */

// 预报水位获取
export const getSelectForecast = (p) =>
  post("/real/getSelectForecast", p, true);

// 水位站实时水位获取
export const realStRiverR = (p) => post("/real/realStRiverR", p, true);

// 水库实时水位获取
export const getSchemeDataSWNS = (p) => post("/real/realStRsvrR", p, true);

// 水位预报方案预测
export const getForecastSW = (p) => post("/water/getRiverData", p, true);

// 水位预报方案计算
export const getComputeSW = (p) => post("/water/getRunRiverData", p, true);

// 水位预报方案获取
export const getFetchSW = (p) => post("/water/getWaterData", p, true);

// 地图断面冲淤过程
export const getXscdSedAccumulate = (p) =>
  post("/real/getXscdSedAccumulate", p, true);

// 获取沿程冲淤量累积
export const getSedAccumulate = (p) => post("/real/getSedAccumulate", p, true);

// 四库单站水沙计算
export const getSingleHydrodynamicModel = (p) =>
  post("/sedModel/getSingleHydrodynamicModel", p);

// 长江中下游单站水沙计算
export const getSingleStation = (p) =>
  post("/yangtzeRiverModel/model/singleStation", p);

// 获取降雨量数据
export const getRainFalls = (p) => post("/sedModel/getRainFalls", p);

// 获取降雨量计算数据
export const getRainFallModel = (p) => post("/sedModel/getRainFallModel", p);

// 降雨量模型新增
export const addRainModelInfo = (p) =>
  post("/rainInfo/addRainModelInfo", p, true);

// 降雨量模型删除
export const delRainModelInfo = (p) =>
  post("/rainInfo/delRainModelInfo", p, true);

// 降雨量模型保存
export const updataRainModelInfo = (p) =>
  post("/rainInfo/updataRainModelInfo", p);

// 获取降雨量计算数据
export const getSelectRainModelInfo = (p) =>
  post("/rainInfo/selectRainModelInfo", p, true);

/* ——————————————————————单站水沙模型—————————————————————— */
// 获取单站水沙模型方案列表/查询单方案数据
export const selectSingleWaterModelInfo = (p) =>
  post("/singleWaterInfo/selectSingleWaterModelInfo", p, true);

// 单站水沙模型方案新增
export const addSingleWaterModelInfo = (p) =>
  post("/singleWaterInfo/addSingleWaterModelInfo", p, true);

// 单站水沙模型方案删除
export const delSingleWaterModelInfo = (p) =>
  post("/singleWaterInfo/delSingleWaterModelInfo", p, true);

// 单站水沙模型方案修改
export const updataSingleWaterModelInfo = (p) =>
  post("/singleWaterInfo/updataSingleWaterModelInfo", p);
